﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NoodleShop.Api.Messaging
{
    public class MessagingService : IMessagingService
    {
        public delegate Task MessageSender(string message, params string[] args);

        private MessageSender _messageSender;

        public MessagingService(IMessageSender messageSender)
        {
            _messageSender = new MessageSender(messageSender.Send);
        }

        public async Task Send(string message, params string[] args)
        {
            await _messageSender.Invoke(message, args);
        }
    }
}
